try {
const tz = uci.get('system', '@system[0]', 'zonename')?.replaceAll(' ', '_');
const ts = uci.get('system', '@system[0]', 'clock_timestyle') || 0;
- const hc = uci.get('system', '@system[0]', 'clock_hourcycle') || 'h23';
+ const hc = uci.get('system', '@system[0]', 'clock_hourcycle') || 0;
const logEntries = await callLogRead(this.fetchMaxRows, false, true);
const dateObj = new Intl.DateTimeFormat(undefined, {
dateStyle: 'medium',
timeStyle: (ts == 0) ? 'long' : 'full',
- hourCycle: hc,
+ hourCycle: (hc == 0) ? undefined : hc,
timeZone: tz
});
const date = new Date(unixtime * 1000);
const zn = uci.get('system', '@system[0]', 'zonename')?.replaceAll(' ', '_') || 'UTC';
const ts = uci.get('system', '@system[0]', 'clock_timestyle') || 0;
- const hc = uci.get('system', '@system[0]', 'clock_hourcycle') || 'h23';
+ const hc = uci.get('system', '@system[0]', 'clock_hourcycle') || 0;
datestr = new Intl.DateTimeFormat(undefined, {
dateStyle: 'medium',
timeStyle: (ts == 0) ? 'long' : 'full',
- hourCycle: hc,
+ hourCycle: (hc == 0) ? undefined : hc,
timeZone: zn
}).format(date);
}
var date = new Date(unixtime * 1000),
zn = uci.get('system', '@system[0]', 'zonename')?.replaceAll(' ', '_') || 'UTC',
ts = uci.get('system', '@system[0]', 'clock_timestyle') || 0,
- hc = uci.get('system', '@system[0]', 'clock_hourcycle') || 'h23';
+ hc = uci.get('system', '@system[0]', 'clock_hourcycle') || 0;
datestr = new Intl.DateTimeFormat(undefined, {
dateStyle: 'medium',
timeStyle: (ts == 0) ? 'long' : 'full',
- hourCycle: hc,
+ hourCycle: (hc == 0) ? undefined : hc,
timeZone: zn
}).format(date);
}
var date = new Date(epoch * 1000),
zn = uci.get('system', '@system[0]', 'zonename')?.replaceAll(' ', '_') || 'UTC',
ts = uci.get('system', '@system[0]', 'clock_timestyle') || 0,
- hc = uci.get('system', '@system[0]', 'clock_hourcycle') || 'h23';
+ hc = uci.get('system', '@system[0]', 'clock_hourcycle') || 0;
return new Intl.DateTimeFormat(undefined, {
dateStyle: 'medium',
timeStyle: (ts == 0) ? 'long' : 'full',
- hourCycle: hc,
+ hourCycle: (hc == 0) ? undefined : hc,
timeZone: zn
}).format(date);
}
};
o = s.taboption('general', form.Flag, 'clock_timestyle', _('Full TimeZone Name'), _('Unchecked means the timezone offset (E.g. GMT+1) is displayed'));
- o.default = o.enabled;
o = s.taboption('general', form.ListValue, 'clock_hourcycle', _('Time Format'));
o.value('', _('Default'));